<html>
	<head>
	<meta content="IE=edge" http-equiv="X-UA-Compatible"></meta>

<meta content="width=device-width, initial-scale=1" name="viewport"></meta>

<meta content="" name="description"></meta>

<meta content="" name="author"></meta>
		<title>E-Learning of TetraSMA</title>
		<!-- Bootstrap Core Style -->
		
		<link rel="stylesheet" type="text/css" href="css/bootstrap/css/bootstrap.min.css">
		<!-- Bootstrap Core Theme -->
		<link rel="stylesheet" type="text/css" href="css/bootstrap/css/bootstrap-theme.min.css">
<script>
var ajaxku;
function username(nama){
 ajaxku = buatajax();
 var url="proses/username.php?stat=guru&&username="+nama;
 ajaxku.onreadystatechange=guru;
 ajaxku.open("GET",url,true);
 ajaxku.send(null);
}


function buatajax(){ 
if (window.XMLHttpRequest){ 
return new XMLHttpRequest(); 
} 
if (window.ActiveXObject){ 
return new ActiveXObject("Microsoft.XMLHTTP"); 
} 
return null; 
}

function gru(){
var data;
 if (ajaxku.readyState==4){
 data=ajaxku.responseText;
 if(data.length>0){
 document.getElementById("name").innerHTML = data;
 }else{
 document.getElementById("name").innerHTML = '';
 }
 }
}

	</script>


	</head>
	<body>

	<input class="form-control" type="text" name="username" placeholder="Username"  onkeyup="username(this.value)" required/>
	<div id="name"></div> 

		<!-- JQuery Core -->
		<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
		<!-- Bootstrap Javascript Core -->
		<script type="text/javascript" src="css/bootstrap/js/bootstrap.min.js"></script>
		<!-- Custom Javascript Load Page -->
		
	</body>
</html>